//
//  DrawingView.h
//  TabulaImaginarius2
//
//  Created by TA2 on 5/3/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/CATiledLayer.h>
#import "Map.h"

@interface DrawingView : UIView {
    Map				*map;
	CGPoint			lastPoint;
	CGPoint			currentPoint;
	CGFloat			scale;
	CGSize			tileSize;
	UIColor			*drawingColor;
	BOOL			snapToGrid;
	BOOL			isConstructingSnapLine;
	int				currentLayerIndex;
}

@property (nonatomic) CGFloat scale;
@property (nonatomic) CGPoint currentPoint;
@property (nonatomic) CGSize tileSize;
@property (nonatomic, retain) UIColor *drawingColor;
@property (nonatomic, retain) Map *map;
@property (nonatomic) BOOL snapToGrid;
@property (nonatomic) int currentLayerIndex;

- (id)initWithMap:(Map *)map withTileSize:(CGSize)size withScale:(int)scale;
- (CGPoint)convertCoordsToGridCoords:(CGPoint)coords;
- (CGPoint)closestCornerPoint:(CGPoint)point;
- (BOOL)isCloseToCorner:(CGPoint)point;

@end
